package com.qujia.customer.domain;

import io.swagger.annotations.ApiModel;
import lombok.Data;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Data
@ApiModel("电子卡统计实体类")
public class ElecSumInfo {
    //类型
    private String type;
    //金额
    private BigDecimal amt;
    // 赠送金额
    private BigDecimal presentAmt;
    // 自动扣减金额
    private BigDecimal manualDeduction;


    public static Map<String,BigDecimal> listToMap(List<ElecSumInfo> elecSumInfos){
        if (elecSumInfos == null) return null;
        Map<String,BigDecimal> map = new HashMap<>();
        for (ElecSumInfo elecSumInfo : elecSumInfos) {
            map.put(elecSumInfo.getType(),elecSumInfo.getManualDeduction());
        }
        return map;
    }

}
